<%--
  Created by IntelliJ IDEA.
  User: aaa
  Date: 2024/6/27
  Time: 14:55
  To change this template use File | Settings | File Templates.
--%>
<html>
<head>

  <meta charset="UTF-8">
  <title>Title</title>
  <style>
    body {
      margin: 0;
      padding: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      height: 100vh;
      background-color: #f0f0f0;
    }

    #Add {
      border: black solid 2px;
      width: 650px;
      height: 300px;
      color: mediumslateblue;
      font-size: 20px;
      padding: 20px;
      box-sizing: border-box;
    }
    textarea {
      width: 600px;
      height: 100px;
      font-size: 16px;
      color: grey;
      display: block;
      margin: 0 auto;
    }
    input {
      display: block;
      margin: 20px auto;
      padding: 5px 15px;
      font-size: 16px;
    }
  </style>
</head>
<body>
<div id="content">
  <!-- Your content goes here -->
</div>
<div id="Add">
  请答题
  <br>
  <form action="StudentServlet?action=dealAnswer&taskAccount=${taskAccount}"  method="post" onsubmit="return isDeal()">
    <textarea id="answer" name="answer"></textarea>
    <br>
    <input type="submit" value="提交">

  </form>
  <span style="color: red">${tip}</span>
</div>
</body>
<script>
  function isDeal(){
    var text=document.getElementById("answer").value;
    if(text.trim()==""||text==null){
      alert("答案不能为空")
      return false;
    }else {
      return true;
    }
  }
</script>
</html>